home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / Asymptote Demo / Examples / Demos / 8) Blackbody Figure / Plot_BlackBody_Figure < prev    next >
Encoding:
Text File  |  1994-05-07  |  1.6 KB  |  57 lines  |  [TEXT/DWat]

  1. % Plot a series of blackbody curves (Planck functions)
  2.  
  3. npts 200
  4. graphlimits 4 24 -30 15
  5. graphframe 1.5 7 2 9
  6. fullscreen yes
  7. graphticks -1 2 -1 2    % Log ticks, small every decade, big every 2 decades
  8. notation scientific    % Force axis labels to have only the exponent part
  9. digits 0        % in scientific notation
  10. fontsize 10        % Use a smaller font because there are so many labels
  11. drawframe
  12. drawxlabel Frequency, \sn [Hz]
  13. drawylabel Brightness B\d\sn(T) [erg s\\u-1\\d cm\\u-2\\d Hz\\u-1\\d steradian\\u-1\\d]
  14. scale scale 2 *        % Draw the title twice as big
  15. drawtitle Blackbody Curves
  16. scale scale 2 /
  17.  
  18. % Draw some double arrows to indicate basic wavelength bands
  19. scale scale 0.75 *
  20. drawdoublearrow xleft "ybottom 2 +" 11.5 "ybottom 2 +" Radio
  21. drawdoublearrow 11.5 "ybottom 2 +" 14.0 "ybottom 2 +" Infrared
  22. drawdoublearrow 14.0 "ybottom 2 +" 15.5 "ybottom 2 +" Optical
  23. drawdoublearrow 15.5 "ybottom 2 +" xright "ybottom 2 +" "X ray and ultraviolet"
  24. scale scale 0.75 /
  25.  
  26. % Restore default values
  27. fontsize
  28. notation
  29.  
  30. % Fill the x data with values that span the current graph limits
  31. xrange xleft xright
  32.  
  33. % Set a variable (T) and loop it to calculate each curve
  34. % The step expression "10 T * T -" increments T by a factor of
  35. % 10 with each step
  36. for T from 10 to 1E10 by 10 T * T - do Plot_Next_BlackBody T
  37.  
  38. % Add a second x axis to show the wavelengths
  39. notation scientific
  40. digits 0
  41.  
  42. fontsize 10
  43. % Offset the axis 3/4 of an inch below the first x axis
  44. graphframe gleft gright gbottom 0.75 - gtop
  45.  
  46. % Calcuate the limits for the wavelength (lambda = c/nu)
  47. graphlimits c xleft 10^x / log c xright 10^x / log 0 0
  48.  
  49. % Draw the axis and its label
  50. drawaxis bottom
  51. drawxlabel Wavelength, \sl [cm]
  52.  
  53.  
  54.  
  55.  
  56.  
  57.